package com.itheima.day14.Myvolatile.test2;

import java.util.concurrent.Callable;

// 小皮
public class MyCallable2 implements Callable {

    @Override
    public Object call() throws Exception {
        while (true){
            synchronized (Money.obj){
                if(Money.money >= 10000){
                    System.out.println("钱还不少");
                }else {
                    System.out.println("钱变少了！只剩" + Money.money +"元");
                    break;
                }
            }
        }

        return null;
    }
}
